package day7.listtest;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author joker
 * @date 2022/4/17 0017 - 15:51
 */
public class ListTest {
    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>();

        boolean a = list.add("a");
//        System.out.println(a);
        list.add("b");
//        System.out.println(list.size());
//        StringBuffer sb = new StringBuffer("a");
//        sb.append("b");
//        System.out.println(sb);
        list.add("c");
        list.add("d");
        list.add("e");
        list.add("e");
        list.add(null);
        list.add(null);
//        System.out.println(list);
//        System.out.println(list.get(1));
//        list.forEach(System.out::println);
        List<Integer> integers = Arrays.asList(1, 2, 3);
//        list.add(integers);
        list.addAll(3,integers);
        System.out.println(list);
//        System.out.println(list.subList(3,6));
//        list.remove(2);
        list.remove(null);
//        list.removeIf(o -> "e".equals(o));
        list.removeAll(Collections.singleton("e"));
        System.out.println(list);
        Object o = list.get(7);
        System.out.println(o);
        System.out.println(o instanceof Object);
        Integer in =1;
        Character ch='a';
        System.out.println(ch);
        System.out.println(ch instanceof Character);
//        Object[] objects = list.toArray();
//        System.out.println(Arrays.toString(objects));
    }
}
